How Do I Save and Load a Diagram?

Each built-in diagram type has its own XML serializer which you can use to save the diagram to XML and load it back in again.

For standard diagrams, use the DiagramXmlSerializer. For flow diagrams, use the FlowDiagramXmlSerializer; for star diagrams, use the StarDiagramXmlSerializer.

If you have a custom diagram type, or if you don’t want to use XML, you can traverse the diagram model programmatically using the Nodes and Connections lists.